home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_2 / rnet107u.zip / PCBLOGIN.SLT < prev    next >
Text File  |  1991-01-03  |  9KB  |  248 lines

  1. // ------------------------------------------------------------------------- //
  2. //
  3. //   PCBoard Login Script -- Handles Lang, Graphics, login name, password.
  4. //     Processes until main board command.  Will "register" if not current.
  5. //     Automatically goes into a specified door from PCBoard/ProLogon.
  6. //
  7. //     Modification of track values may be needed to properly handle
  8. //     modified prompts if the host sysop has used that option.
  9. //
  10. //     Compile with   CS PCBLOGIN   which will produce PCBLOGIN.SLC.
  11. //     Add PCBLOGIN for autoscript entry in your telix dialing directory.
  12. //
  13. //     10-31-1988  Added newuser processing
  14. //     07-16-1989  Added ProLogin support and ProLogon quick logon
  15. //     01-17-1990  Added pop-up windows
  16. //
  17. //     Robert Vostreys, FTL Sysop, 404-292-8761, 404-299-3930 HST
  18. //
  19. // ------------------------------------------------------------------------- //
  20. //
  21. //  Edit the string entries below to reflect the login needed for echomail.
  22. //
  23. //  Set the pro_door[] and first_cmd[] strings to point to the mail door.
  24. //
  25. //  Compile (CS PCBLOGIN) and place this as the autoscript in your Telix
  26. //  dialing directory entries used for netmail.  If you use a different login
  27. //  for yourself vs echomail (suggested), you may want to rename this script
  28. //  to something else so you use PCBLOGIN for your own login and perhaps
  29. //  NETLOGIN for echomail login since the username is different.
  30. //
  31. //  I recommend using different dialing directory entries for personal and
  32. //  echomail logins, so the "autoscript" can be different (PCBLOGIN vs
  33. //  NETLOGIN).
  34. //
  35. // ------------------------------------------------------------------------- //
  36.  
  37. str user_name[]  = "FTL MAILRUN";
  38. str city_state[] = "Robert Vostreys - Atlanta";
  39. str data_phone[] = "404-292-8761";
  40. str home_phone[] = "404-299-3930";
  41. str unknown_pw[] = "NEWPASSWORD";   // used if entry not in dialing directory
  42. str cpu_type[]   = "C&T 386/25";
  43. str graphicsYN[] = "Y";             // do you want graphics or non?  (Y/N)
  44. str pro_door[]   = "3";             // door to open if logging into ProLogon
  45. str first_cmd[]  = "DOOR;3";        // door (first command) if in PCBoard
  46.  
  47. // ------------------------------------------------------------------------- //
  48.  
  49. main()
  50.  {
  51.    int stat = 0;
  52.    int flag = 0;
  53.    int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
  54.    int t99 = 0;
  55.    int pcblogin = 0;
  56.    int endflag = 0;
  57.  
  58.    t1  = track(" graphics", 1);             //  ANSI Graphics Prompt
  59.    t2  = track("first name?", 1);           //  Name Prompt (put FN;LN^MPW)
  60.    t3  = track("Language #", 1);            //  Language Prompt (1=English?)
  61.    t4  = track("(H)elp, More?", 1);         //  Y/N/NS More prompt
  62.    t5  = track("continue", 1);              //  Press (ENTER) to continue
  63.    t6  = track("(Enter)=yes?", 1);          //  Scan messagebase (Y/N/A NS)
  64.    t7  = track("Command?", 1);              //  Main Board Command?
  65.    t8  = track("Conference memb", 1);       //  View Conference Members
  66.    t9  = track("as a new user?", 1);        //  OOPS! New user here!
  67.    t10 = track("word please!)?", 1);        //  Enter PASSWORD
  68.    t11 = track("City and State", 1);        //  City and State
  69.    t12 = track("DOOR #", 1);                //  ProLogin command prompt
  70.    t13 = track("Re-enter password", 1);     //  Verify new password login
  71.    t14 = track("(Dots will echo)", 1);      //  Actual Password Prompt
  72.    t15 = track("ProLogon");                 //  Look for ProLogin system
  73.  
  74. // ------------------------------------------------------------------------- //
  75.  
  76.   t99 = timer_start(200);                   // No response for 20 seconds
  77.  
  78.   while (carrier() and endflag == 0)
  79.  
  80.    {
  81.      terminal();
  82.  
  83.      stat = track_hit(0);                   // see if any flags set
  84.  
  85.      if (stat)                              // reset timer when track hits
  86.       {
  87.         timer_restart(t99, 200);
  88.       }
  89.  
  90.      if (time_up(t99))
  91.       {
  92.         status_wind("WAKEUP!", 1);
  93.         cputs("^M");
  94.         timer_free(t99);
  95.         t99 = timer_start(200);
  96.         terminal();
  97.       }
  98.  
  99.       if (stat == 15)
  100.        {
  101.          track_free(t3);
  102.          t3 = track("(0)=no");
  103.          pcblogin = 1;
  104.        }
  105.  
  106.       else if (stat == t3)                  // request language
  107.          cputs("1^M");
  108.  
  109.       else if (stat == t1)                  // ANSI graphics request
  110.        {
  111.          if (pcblogin == 0)
  112.           {
  113.             cputs(graphicsYN);
  114.             cputs(" Q NS^M");
  115.             terminal();
  116.           }
  117.          else                               // ProLogon quick login
  118.           {
  119.             track_free(t4);
  120.             t4 = track("(N)",1);
  121.             cputs(graphicsYN);
  122.             cputs(" Q ");
  123.             cputs(user_name);
  124.             cputs(" ");
  125.             cputs(_entry_pass);
  126.             cputs(" ");
  127.             cputs(pro_door);
  128.             cputs(" NS^M");
  129.             terminal();
  130.             endflag = 1;
  131.             status_wind("Login sequence completed...", 10);
  132.           }
  133.        }
  134.  
  135.       else if (stat == t2)                  // send Login Name
  136.        {
  137.          if (pcblogin == 0)
  138.           {
  139.             capture("*CLOSE*");
  140.             cputs(user_name); cputs("^M");
  141.           }
  142.          if (pcblogin == 1)                 // ProLogon quick login 2nd try
  143.           {
  144.             capture("*CLOSE*");
  145.             track_free(t4);
  146.             t4 = track("(N)",1);
  147.             cputs(user_name);
  148.             cputs(" ");
  149.             cputs(_entry_pass);
  150.             cputs(" ");
  151.             cputs(pro_door);
  152.             cputs(" NS^M");
  153.             terminal();
  154.             cputs("^M");
  155.             endflag = 1;
  156.             status_wind("Login sequence completed...", 10);
  157.           }
  158.        }
  159.  
  160.       else if (stat == t4)                  // don't want any "more"
  161.          cputs("No_More^M");
  162.  
  163.       else if (stat == t5)                  // "Enter" to continue
  164.          cputs("^M");
  165.  
  166.       else if (stat == t6 || stat == t8)    // No, don't show messages
  167.        {                                    // Yes, we want to register
  168.          if (flag == 0)                     // Also, no conf member scan
  169.             cputs("NoScan^M");
  170.          else
  171.           {
  172.             capture("*CLOSE*");
  173.             cputs("Yes^M");
  174.             flag = 0;
  175.           }
  176.        }
  177.  
  178.       else if (stat == t7 or stat == t12)   // Login Compleated
  179.        {
  180.          if (pcblogin == 0)
  181.           {
  182.             cputs(first_cmd);
  183.             cputs("^M");
  184.             terminal();
  185.             status_wind("Login sequence completed...", 10);
  186.             endflag = 1;
  187.           }
  188.          if (pcblogin == 1)
  189.           {
  190.             cputs(pro_door);
  191.             cputs("^M");
  192.             terminal();
  193.             status_wind("Login sequence completed...", 10);
  194.             endflag = 1;
  195.           }
  196.        }
  197.  
  198.       else if (stat == t9)                  // New User Login (Continue)
  199.        {
  200.          capture ("NEWLOGIN.CAP");
  201.          cputs("C^M");
  202.          flag = 1;
  203.        }
  204.  
  205.       else if (stat == t10 || stat == t13 || stat == 14)
  206.        {
  207.          Go_Password();                     // Password Entry / Verify / Go
  208.          track_free(t14);                   // don't allow the main password
  209.        }                                    // request to reoccur.
  210.  
  211.  
  212.       else if (stat == t11)                 // City/State Prompt
  213.        {
  214.          status_wind("NEW USER LOGIN!!", 20);
  215.          cputs(city_state);
  216.            cputs("^M");
  217.          cputs(data_phone);                 // also put dataphone
  218.            cputs("^M");
  219.          cputs(home_phone);                 // also put homephone
  220.            cputs("^M");
  221.          cputs(cpu_type);                   // also put cputype
  222.            cputs("^M");
  223.        }
  224.    }
  225.  
  226.   capture ("*CLOSE*");                      // Close any open captures
  227.   timer_free(t99);                          // Clear all timer channels
  228.   track_free(0);                            // Clear all track channels
  229.   return(0);                                // Exit this login script.
  230.  }
  231.  
  232. // ------------------------------------------------------------------------- //
  233.  
  234. Go_Password()
  235.  {
  236.    if (strlen(_entry_pass) < 2)
  237.     {
  238.       cputs(unknown_pw);
  239.       cputs(itos(_entry_num));
  240.     }
  241.    else
  242.       cputs(_entry_pass);
  243.    cputs("^M");
  244.  }
  245.  
  246. // ------------------------------------------------------------------------- //
  247.  
  248.